﻿using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Windows.Devices.Geolocation;
using BuddyTracker.Model;
using BuddyTracker.ViewModel.Helpers;

namespace BuddyTracker.Interfaces
{
    interface IServiceProvider
    {
        /// <summary>
        /// Opens new windows for login or equivalent.
        /// </summary>
        Task<Uri> Login();
        /// <summary>
        /// Sends location as encoded message to service provider.
        /// </summary>
        Task PostLocation(Geopoint location, ILocationEncoder locationEncoder);
        /// <summary>
        /// Logs off the user.
        /// </summary>
        void LogOff();
        /// <summary>
        /// Initializes OpenAuth with supplied PIN.
        /// </summary>
        /// <returns>True if logged in succesfully.</returns>
        Task<Boolean> Auth(string PIN); //has to be task because async
        /// <summary>
        /// Searchs for all buddies in the list and updates the view.
        /// </summary>
        Task Search(ObservableCollection<User> buddyNames, LocationHelper helper);
        /// <summary>
        /// Returns is the user logged in.
        /// </summary>
        bool IsLoggedIn();
        /// <summary>
        /// Returns logged in user's name;
        /// </summary>
        string Username();
    }
}
